#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int A = 0;
	int B = 0;
	char ch = 0;
	while (scanf("%c", &ch) !=EOF)
	{
		if (ch == '0')
		{
			break;
		}
		else if(ch == 'A')
		{
			A++;
		}
		else
		{
			B++;
		}
	}
		if (A > B)
		{
			printf("A");
		}
		else if (A < B)
		{
			printf("B");
		}
		else
		{
			printf("E");
		}

	return 0;
}